﻿
<div class="panel panel-default padding-empty">
    <div class="panel-body padding-empty">
        <ol class="breadcrumb margin-empty">
            <li class="breadcrumb-color"><i class="fa fa-home"></i>&nbsp;主页</li>
            <li><a href="#/examPlan/list" class="breadcrumb-link">考场监控管理</a></li>
            <li class="active">{{planName}} - 考场监控</li>
        </ol>
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">
        <!--<h3>
            <i class="fa fa-desktop"></i>
            {{planName}} - 考场监控

            &nbsp;
            <button class="btn btn-turquoise btn-xs" onclick="javascript:history.go(-1);" title="返回上一页" style="margin-bottom: 0;">
                <i class="fa fa-chevron-left"></i>
            </button>
        </h3>-->

        <div class="panel-options">
            <small class="control-label pull-right">
                考场：
                <select ng-model="curRoom" ng-options="item.examRoomName for item in roomList" ng-change="changeRoom()"></select>
            </small>
        </div>
    </div>

    <div class="panel-body">
        <!--延迟考试时长-->
        <div ng-show="sss">
            <div class="modal-body">
                <form id="delayForm" role="form" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-4 control-label" for="minutes">延时时长(分钟)：</label>

                        <div class="col-sm-6">
                            <input type="number" class="form-control input-inline" id="minutes" name="minutes" ng-model="minutes" placeholder="请输入延时时长" ng-disabled="loadingState" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-4 control-label" for="reason">理由：</label>

                        <div class="col-sm-6">
                            <textarea rows="3" class="form-control input-inline" id="reason" name="reason" ng-model="reason" placeholder="请输入理由" ng-disabled="loadingState"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer text-right">
                <button type="submit" class="btn btn-turquoise" ng-click="save();" ng-disabled="loadingState" style="margin-bottom: 0;">
                    <i class="fa fa-save" ng-hide="loadingState"></i>
                    <i class="fa fa-spinner fa-spin" ng-show="loadingState"></i>
                    <span>保存</span>
                </button>
                <button type="button" class="btn btn-gray" ng-click="close();" ng-disabled="loadingState">
                    <i class="fa fa-close"></i>
                    <span>关闭</span>
                </button>
            </div>
        </div>

        <!--下拉框搜素-->
        <form class="form-inline" ng-hide="sss">
            <div class="form-group" ng-hide="isAnyTime">
                <label class="control-label">场次：</label>
                <select ng-model="curScene" ng-options="item.examSceneName for item in sceneList" class="form-control selectMaxWidth"></select>
            </div>

            <div class="form-group">
                <label class="control-label">科目：</label>
                <select ng-model="curSubject" ng-options="item.subjectName for item in subjectList" class="form-control selectMaxWidth"></select>
            </div>

            <div class="form-group">
                <label class="control-label">考生状态：</label>
                <select ng-model="curStatus" ng-options="item.StatusName for item in statusList" class="form-control selectMaxWidth"></select>
            </div>

            <div class="form-group">
                <input ng-model="curParams" class="form-control selectMaxWidth" maxlength="30" placeholder="准考证或姓名" />
            </div>

            &nbsp;
            &nbsp;

            <button class="btn btn-turquoise" ng-click="query(1);" style="margin-bottom: 0;">
                <i class="fa fa-search"></i>
                搜索
            </button>
            <button class="btn btn-turquoise pull-right" ng-click="download()" style="margin-bottom: 0;">
                <i class="fa fa-download"></i>
                导出
            </button>
            <button class="btn btn-turquoise pull-right" ng-click="delayAllExam();" ng-hide="isAnyTime||isRoomDelayed" style="margin-bottom: 0;">
                <i class="fa fa-history"></i>
                整场延时
            </button>
        </form>

        <br />
        <!--<div style="max-height:300px;overflow:auto;">-->
            <table class="table responsive table-bordered table-hover table-condensed">
                <thead>
                    <tr class="active">
                        <th></th>
                        <!--<th class="text-center">#</th>-->
                        <th>科目</th>
                        <th>准考证号</th>
                        <th>考生姓名</th>
                        <th ng-show="isSeatByNumberRequired">座位号</th>
                        <th>考试状态</th>
                        <th>登录方式</th>
                        <!--<th>签到状态</th>-->
                        <th>剩余时间</th>
                        <!--<th>计划开考时间</th>-->
                        <th>实际开考时间</th>
                        <th class="text-center">预警状态</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in list.items" cancel-timer>
                        <!--操作-->
                        <td>
                            <div class="btn-group">
                                <button type="button" class="btn btn-turquoise btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    操作
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li ng-repeat="curOper in operList" ng-click="oper(this)"><a href="javascript:;">{{curOper.operName}}</a></li>
                                </ul>
                            </div>
                            <!--<select ng-model="curOper" ng-options="oper.operName for oper in operList" ng-change="changeOper(this)" class="form-control"></select>-->
                        </td>
                        <!--序号-->
                        <!--<td class="text-center">
                            {{$index+1}}
                        </td>-->
                        <!--科目-->
                        <td title="{{item.examSubjectName}}">
                            {{item.examSubjectName | formatLongStr}}
                        </td>
                        <!--准考证号-->
                        <td>
                            <a href="javascript:void(0);" title="查看该学生详细信息" ng-click="examineeDetail(item)" style="color: blue;">
                                {{item.examCardNo}}
                            </a>
                        </td>
                        <!--考生姓名-->
                        <td ng-switch on="item.ifDeregulation">
                            {{item.examineeName}}
                            <span ng-switch-default><i class="fa fa-close text-danger" title="标记违纪"></i></span>
                            <span ng-switch-when="0"></span>
                        </td>
                        <!--座位号-->
                        <td ng-show="isSeatByNumberRequired">
                            {{item.seatNo}}
                        </td>
                        <!--考生状态-->
                        <td ng-switch on="item.examStatus">
                            <span ng-switch-default></span>
                            <span ng-switch-when="0">未开考</span>
                            <span ng-switch-when="1">已登录</span>
                            <span ng-switch-when="2">已开考未交卷</span>
                            <span ng-switch-when="3">已交卷</span>
                        </td>
                        <!--登录方式-->
                        <td ng-switch on="item.faceCompareResult">
                            <span ng-switch-default></span>
                            <span ng-switch-when="1">身份验证登录</span>
                            <span ng-switch-when="0">承诺书登录</span>
                        </td>
                        <!--签到状态-->
                        <!--<td>
                            <div ng-show="item.todayIDCard" ng-switch on="item.iDCardResult">
                                <span ng-switch-when="0">未签到</span>
                                <span ng-switch-when="1">系统签到</span>
                                <span ng-switch-when="2">人工签到</span>
                            </div>
                            <div ng-hide="item.todayIDCard">
                                未签到
                            </div>
                        </td>-->
                        <!--剩余时间-->
                        <td ng-switch on="item.examStatus">
                            <span ng-switch-default>{{item.retainTime | formatSecond}}</span>
                            <span ng-switch-when="0"></span>
                            <span ng-switch-when="3"></span>
                        </td>
                        <!--应开考时间-->
                        <!--<td ng-bind-html="item.planBeginTime | formatLineDate | date: 'yyyy-MM-dd HH:mm'"></td>-->
                        <!--考生开考时间-->
                        <td ng-switch on="item.examStatus" style="cursor: pointer;" title="考生结束时间：{{item.endTime | formatDateNoSs | date: 'yyyy-MM-dd HH:mm'}}">
                            <span ng-switch-default ng-bind-html="item.relBeginTime | formatLineDate | date: 'yyyy-MM-dd HH:mm'"></span>
                            <span ng-switch-when="1"></span>
                            <span ng-switch-when="0"></span>
                        </td>
                        <!--预警状态-->
                        <td ng-switch on="item.faceCompareFailCount">
                            <span ng-switch-default style="color:red;">异常提示</span><!--大于0异常-->
                            <span ng-switch-when="0" style="color: blue;">正常</span>
                        </td>
                    </tr>
                </tbody>
            </table>
        <!--</div>-->

        <div class="page-list" ng-hide="list.totalPage==1">
            <div style="text-align: right;">
                <nav>
                    <ul class="pagination" style="margin-bottom:0;">
                        <li>
                            <a ng-click="Previous()" role="button">
                                <span role="button">上一页</span>
                            </a>
                        </li>
                        <li>
                            <a ng-click="Next()" role="button">
                                <span role="button">下一页</span>
                            </a>
                        </li>
                        <li>
                            <a style="border: none;margin-left: 0px;background: #FFF!important;">
                                第<input type="text" ng-model="currentPage" ng-keyup="selectPage()" style="width:40px;margin-top:-2px;text-align:center;">页
                                共<strong>{{totalPage}}</strong>页
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>

        <h3 class="text-center" ng-if="list.length <= 0">
            <img src="//openexamcdn.open.com.cn/openexam/static/App/images/nodata.jpg" alt="" />
            <!--<small>对不起，没有相关数据！</small>-->
        </h3>
    </div>
</div>

<script>
    $(function () {
        $('form#delayForm').validate({
            rules: {
                minutes: {
                    required: true,
                    digits: true,
                    number: true,
                    min: 1
                }
            },
            messages: {
                minutes: {
                    required: '请输入延时时长！',
                    digits: '请输入整数分钟！',
                    number: '请输入整数分钟！',
                    min: '请输入大于1分钟的延时时长！'
                }
            }
        });
    });
</script>
